from django.db import models
from django.contrib import admin
from django.contrib.auth.models import User

class cafe(models.Model):
    cafe_name  = models.CharField(max_length = 30)
    cafe_stret = models.CharField(max_length = 30)
    cafe_house = models.CharField(max_length = 5)
    cafe_price = models.CharField(max_length = 5)
    cafe_logo = models.ImageField(upload_to = 'up/logo')
    cafe_reiting = models.CharField(max_length = 3)
    cafe_geo = models.CharField(max_length = 25 )
    class Meta:
       ordering = ('-id',)

class coment(models.Model):
   text = models.TextField() 
   title = models.CharField(max_length = 20)
   date = models.DateTimeField()
   user_id =models.CharField(max_length = 7)
   cafe_id = models.CharField(max_length = 7)
   class Meta:
      ordering = ('-date',)

class critic(models.Model):
   title = models.CharField(max_length = 50)
   text = models.TextField()
   date = models.DateTimeField()
   user_id = models.CharField(max_length = 7)
   tags1 = models.CharField(max_length = 20)
   #tags2 = models.CharField(max_length = 20)
   #tags3 = models.CharField(max_length = 20)
   #tags4 = models.CharField(max_length = 20)
   #tags5 = models.CharField(max_length = 20)

class profile(models.Model):
    user = models.ForeignKey(User, unique=True)
    teg = models.CharField(max_length = 50)

admin.site.register(cafe)
